﻿using System.Collections.Generic;

public class Dict<Key,Value>
{
    public Dictionary<Key, Value> Dictionary { get; private set; }
    public Dict()
    {
        Dictionary = new Dictionary<Key, Value>();
    }
    public virtual void Add(Key key,Value value)
    {
        if (!IsExist(key))
            Dictionary.Add(key, value);
    }
    public virtual void Remove(Key key)
    {
        if (IsExist(key))
            Dictionary.Remove(key);
    }
    public virtual bool IsExist(Key key)
    {
        if (Dictionary.ContainsKey(key))
            return true;
        return false;
    }
    public virtual Value GetValue(Key key)
    {
        if (IsExist(key))
            return Dictionary[key];
        return default;
    }
    public virtual int Count { get { return Dictionary.Count; } }
}

